#include"TcpServer.hpp"
#include"ServerCal.hpp"
#include<unistd.h>

using namespace std;
static void Usage(const string &proc)
{
    cout<<"\nUsage: "<<proc<<" port\n"<<endl;
}

int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t port=stoi(argv[1]);
    ServerCal cal;
    TcpServer *tsvp=new TcpServer(port,std::bind(&ServerCal::Calculator,&cal,std::placeholders::_1));
    tsvp->InitServer();
    tsvp->Start();
    return 0;
}